﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 第二次作业.entity.impl
{
    internal class CreditAccount : Account
    {
        private double creditLimit { get; set; }
        public CreditAccount(string accountName, string accountPassword) : base(accountName, accountPassword)
        {
        }

        public override void withdraw(double amount)
        {
            if (amount > balance + creditLimit)
            {
                throw new InvalidOperationException("超过信用额度！");
            }

            base.withdraw(amount);
        }


    }
}
